package com.xu.mapper;

import com.xu.pojo.Vouchers;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface VouchersMapper {

    @Select("select * from vouchers")
    List<Vouchers> queryAllVouchers();

    @Select("select * from vouchers where id=#{id}")
    Vouchers queryVouchersByPrice(int id);

    @Insert("insert into bread.vouchers (vname,num) values (#{vname},#{num})")
    int addVouchers(Vouchers vouchers);

    @Delete("delete from bread.vouchers where id=#{id}")
    int delVouchers(int id);

    @Select("select * from vouchers where id=#{id}")
    Vouchers queryVouchersById(int id);

    @Update("update bread.vouchers set vname=#{vname},num=#{num} where id=#{id}")
    int updVouchers(Vouchers vouchers);

}
